<?php
namespace app\api\controller\wdsxh;
use app\admin\model\wdsxh\Quickmenu as Model;
/**
 * 快速菜单
 */
class Quickmenu extends Base
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    public function index(){
        $page=$this->request->param('page',1);
        $list=Model::where('status',1)
            ->order('weigh desc')
            ->field('id,name,icon,skip_type,content')
            ->select();
        if($list){
            foreach ($list as $row){
                $row->icon=wdsxh_full_url($row->icon);
                if($row->skip_type == 3){
                    $row->content=json_decode($row->content,true);
                }
            }
        }
        $this->success($list);
    }
}